<template>
  <div class="header">
    <div class="content-wrapper">
      <div class="avatar">
        <img src="/src/assets/icons/Logo.jpg" alt="" />
      </div>
      <div class="content">
        <div class="title">
          <span class="brand"></span>
          <span class="name">牢翔面馆</span>
        </div>
        <div class="description">飞鸟专送/10分钟送达</div>
        <div class="support">
          <SupportIcon :type="0" size="1" />
          <span class="text">在线支付满20减19</span>
        </div>
      </div>
      <div class="support-count">
        <span class="count">3个</span>
        <ion-icon class="iconfont" name="chevron-forward-outline"></ion-icon>
      </div>
    </div>
    <div class="bulletion-wrapper">
      <span class="bulletion-title"></span>
      <span class="bulletion-text"
        >Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ipsa enim
        fuga quaerat debitis est, eius commodi rerum nemo. Maxime iste tempore
        saepe cupiditate quisquam inventore labore sapiente, consectetur itaque
        esse?</span
      >
      <ion-icon
        class="iconfont bl-icon"
        name="chevron-forward-outline"
      ></ion-icon>
    </div>
    <div class="bg"></div>
  </div>
</template>

<script setup>
import SupportIcon from '../support-icon/index.vue';

const bg = 'url(/src/assets/icons/Logo.jpg)';
</script>

<style lang="less" scoped>
@import '@/assets/variable.less';
@import '@/assets/mixin.less';

.header {
  color: @color-white;
  position: relative;
  background-color: @color-background-ss;

  .content-wrapper {
    display: flex;
    padding: 24px 12px 18px 24px;
    position: relative;

    .avatar {
      width: 64px;
      height: 64px;
      border-radius: 2px;
      overflow: hidden;
      img {
        width: 100%;
      }
    }

    .content {
      flex: 1;
      margin-left: 16px;

      .title {
        display: flex;
        margin-bottom: 8px;

        .brand {
          width: 30px;
          height: 18px;
          display: inline-block;
          .bg-image('brand');
          background-size: 100% 100%;
        }

        .name {
          font-size: @fontsize-large;
          margin-left: 6px;
          font-weight: bold;
        }
      }

      .description {
        font-size: @fontsize-small;
        margin-bottom: 8px;
      }

      .support {
        display: flex;
        align-items: center;
        .text {
          font-size: @fontsize-small-s;
          margin-left: 4px;
        }
      }
    }

    .support-count {
      position: absolute;
      right: 12px;
      bottom: 14px;
      height: 24px;
      line-height: 24px;
      background-color: @color-background-sss;
      border-radius: 14px;
      padding: 0 8px;
      display: flex;
      align-items: center;

      .count {
        font-size: @fontsize-small-s;
      }

      .iconfont {
        font-size: @fontsize-small-s;
        margin-left: 2px;
      }
    }
  }

  .bulletion-wrapper {
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    background-color: @color-background-sss;

    .bulletion-title {
      flex: 0 0 22px;
      height: 12px;
      .bg-image('bulletin');
      background-size: 100% 100%;
    }

    .bulletion-text {
      flex: 1;
      margin-left: 4px;
      font-size: @fontsize-small-s;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .blicon {
      flex: 0 0 10px;
      font-size: 8px;
    }
  }

  .bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: v-bind(bg);
    background-size: 100% 100%;
    filter: blur(6px);
    z-index: -1;
  }
}
</style>
